class Solution(object):
    def isSubsequence(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: bool
        """
        left = 0
        right = 0
        n1 = len(s)
        n2 = len(t)
        while left < n1 and right < n2:
            if s[left] == t[right]:
                left += 1
                right += 1
            else:
                right += 1
        if left == n1:
            return True
        else:
            return False

data = Solution()
s = "abc"
t = "ahbgdc"
print(data.isSubsequence(s, t))